<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit">
  	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<title>${SYSTEM_NAME}</title>
	<link rel="stylesheet" href="${pageContext.request.contextPath}/static/layuiadmin/layui/css/layui.css?v=${FILE_VERSION}" media="all">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/static/layuiadmin/style/admin.css?v=${FILE_VERSION}" media="all">
  	<!-- 文件上传 -->
  	<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/fileUpload.css?v=${FILE_VERSION}">
</head>
<body>
<div class="layui-fluid">
	<div class="layui-card">
		<div class="layui-card-body" style="padding: 15px;">
		<form class="layui-form" method="post" id="basicform" >
			<input id="id" name="id" value="" type="hidden">
			
			<div class="layui-form-item layui-form-text">
				<label class="layui-form-label layui-form-required">描述</label>
				<div class="layui-input-block">
					<input name="desp" placeholder="请输入描述"
						class="layui-input" value="" maxlength="100">
				</div>
			</div>
			
			<div class="layui-form-item layui-form-text">
				<label class="layui-form-label">图片</label>
				<div class="layui-input-block">
					<div class="layui-upload-list"  style="width:100px">
				  		<input id="images" class="fileUrl" name="images" value="" type="hidden">
				    	<img id="uploadImg" class="layui-upload-img" src="${pageContext.request.contextPath}/static/images/addImg.png">
				  	</div>
				</div>
			</div>

			<div class="layui-form-item layui-form-text">
				<label class="layui-form-label">单文件选择</label>
				<div class="layui-input-block">
					<div class="layui-upload-list"  style="width:100px">
						<input class="fileUrl" value="" type="hidden">
						<img id="test2" class="layui-upload-img"
							 src="${pageContext.request.contextPath}/static/images/addImg.png"
							onclick="$selectFileManage(1,'test2')" />
					</div>
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">多文件选择</label>
				<div class="layui-input-block">
					<button type="button" class="layui-btn" onclick="$selectFileManage(2,'mutifileImg')">选择图片</button>
					<blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;" >
						预览图<font style="color: red">(可拖拽图标进行排序,排序后请点击保存按钮)</font>：
						<ul class="layui-upload-ul" id="mutifileImg">
						</ul>
						<div style="clear:both;"></div>
					</blockquote>

					<input id="imgsInput" value="" name="imgs" type="hidden">
				</div>
			</div>

			<div class="layui-form-item layui-form-text">
				<label class="layui-form-label layui-form-required">是否显示</label>
				<div class="layui-input-inline">
					<select id="isShow" lay-verify="" name="isShow">
					</select>
				</div>
			</div>
			
			<div class="layui-form-item">
				<div class="layui-input-block">
					<button class="layui-btn" lay-submit="" lay-filter="sub">立即提交</button>
					<button type="reset" class="layui-btn layui-btn-primary">重置</button>
				</div>
			</div>
		</form>
	</div>
	</div>
</div>
	<script src="${pageContext.request.contextPath}/static/js/common-2.0.0.js?v=${FILE_VERSION}"></script>
	<script src="${pageContext.request.contextPath}/static/layuiadmin/layui/layui.js?v=${FILE_VERSION}"></script>
	<script src="${pageContext.request.contextPath}/static/js/jquery-3.3.1.min.js?v=${FILE_VERSION}"></script>
	<script src="${pageContext.request.contextPath}/static/js/common/coreInput-2.0.0.js?v=${FILE_VERSION}"></script>
	<script src="${pageContext.request.contextPath}/static/js/upload/fileUpload-2.0.0.js?v=${FILE_VERSION}"></script>

	<script>
		layui.config({
	  		base: getContextPath() + '/static/layuiadmin/' //静态资源所在路径
	  	}).extend({
	    	index: 'lib/index' //主入口模块
	  	}).use(['form', 'element','upload','layer'], function() {
			var form = layui.form;

			form.on('submit(sub)', function(data){
				layer.msg("测试页面");
				// return saveOrUpdate($("#id").val(),"/sys/guide",data);
			});
		});
		
		function setInit(){
			var images = $('#images').val();
			if(images != ""){
				createImg("#uploadImg",images);
			}

			createFileListByFileUrl("#mutifileImg","test.jpg");
			createFileListByFileUrl("#mutifileImg","test1.jpg");
			createFileListByFileUrl("#mutifileImg","test2.jpg");
			createFileListByFileUrl("#mutifileImg","test3.jpg");
		}
		
		setInit();
		
	</script>
</body>
</html>